home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / ARC.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  949 b   |  35 lines

  1.                                             /* arc.c */
  2.                                  /* Entered by A. Wayner */
  3. # include <graphics.h>
  4. main()
  5. {
  6.     int graphdriver = DETECT;
  7.     int graphmode, xc, yc, radius, stangle, endangle;
  8.     char buffer[80];
  9.  
  10.                                             /* Ask user for parameters of the arc */
  11.     printf("Enter coordinates of center (x, y): ");
  12.     scanf(" %d %d", &xc, &yc );
  13.     printf("\nRadius, start angle and end angle : ");
  14.     scanf(" %d %d %d", &radius, &stangle, &endangle);
  15.  
  16.                                             /* Detect adapter type and    */
  17.                                             /* initialize graphics system */
  18.       initgraph( &graphdriver, &graphmode, "\\turboc");
  19.  
  20.     sprintf( buffer, "arc(%d, %d, %d, %d, %d)",
  21.         xc, yc, stangle, endangle, radius );
  22.     outtextxy( 10, 10, buffer);
  23.  
  24.                                             /* Now draw the arc */
  25.     arc( xc, yc, stangle, endangle, radius );
  26.  
  27.                                             /* Wait until user presses a key */
  28.     outtextxy( 10, getmaxy() - 50, "Press any key to exit");
  29.  
  30.     getch();
  31.     closegraph();
  32.  
  33. }
  34.  
  35.